/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2008, 2009, 2010.

	This file is part of Maxsi Engine.

	Maxsi Engine is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi engine is distributed in the hope that it will be useful, but WITHOUT
	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
	FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
	for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Engine. If not, see <http://www.gnu.org/licenses/>.

	MaxsiEngine.dll
	A general purpose C++ library for the Maxsi Technology Project.

	MaxsiUI_Form.h
	An easier way to create and destroy controls and group them.

******************************************************************************/

//=============================================================================
//	TODO: Maxsi UI is deprecated and should be replaced by something much more
//	elegant, perhaps with the same name, or perhaps even GTK+. It should be
//	lightweight, easy to use, and pretty.
//=============================================================================

#ifndef MaxsiUI_Form_H
#define MaxsiUI_Form_H

BeginMaxsiUINamespace

//=============================================================================
//	MaxsiUI_Form - A system that handles controls upon a Window
//=============================================================================
CLASSLINK MaxsiUI_Form : public ME_Window
{
	Declare_Class(MaxsiUI_Form,ME_Window);

public:
	MaxsiUI_Form( void );

	//virtual bool InitializeForm			(HWND hWnd);
	virtual bool InitializeForm			(ME_Window* Parent);
	virtual bool ForceRedraw			(void);
	virtual bool TerminateForm			(void);
	virtual bool RenderForm				(HWND hWnd);
	virtual bool NewResolution			(WORD Width, WORD Height);
	virtual	bool ReplaceSelfWith		(MaxsiUI_Form* New);
	virtual LRESULT APIENTRY WindowProc				(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

public:		
	//HWND			Window;
	bool			Initialized; // IF NOT TRUE; DO NOT ATTEMPT TO EXECUTE ANYTHING	
	ME_Window*		Parent;

};

//=============================================================================
//	Useful functions for dealing with forms
//=============================================================================
LINK	int				DrawSplitLine	(HDC hDC,size_t yOffset, size_t Width);
LINK	MaxsiUI_Form*	InitializeForm	(MaxsiUI_Form* Form, ME_Window* Parent);
LINK	MaxsiUI_Form*	TerminateForm	(MaxsiUI_Form* Form);
LINK	MaxsiUI_Form*	ReplaceForm		(MaxsiUI_Form* Old, MaxsiUI_Form* New);

EndMaxsiUINamespace

#endif
